﻿Imports System.Transactions
Imports CondorTravel.BE
Imports CondorTravel.DALC

Public Class ProveedorBC

    Public Function ProveedorListar(ByVal objProveedorBE As ProveedorBE, ByRef bExito As Boolean, ByRef sMensaje As String) As List(Of ProveedorBE)
        Try
            Dim listProveedorBE As List(Of ProveedorBE) = Nothing
            Dim objCategoriaDALC As ProveedorDALC = Nothing

            objCategoriaDALC = New ProveedorDALC
            listProveedorBE = New List(Of ProveedorBE)()
            listProveedorBE = objCategoriaDALC.ListarProveedores(objProveedorBE, bExito, sMensaje)

            Return listProveedorBE

        Catch ex As Exception
            Throw
        End Try
    End Function

    Public Function ListarProveedoresxServicio(ByVal objServicioBE As ServicioBE) As List(Of ProveedorBE)
        Try
            Dim listProveedorBE As List(Of ProveedorBE) = Nothing
            Dim objCategoriaDALC As ProveedorDALC = Nothing
            Dim bExito As Boolean = False
            Dim sMensaje As String = String.Empty

            objCategoriaDALC = New ProveedorDALC
            listProveedorBE = New List(Of ProveedorBE)()
            listProveedorBE = objCategoriaDALC.ListarProveedoresxServicio(objServicioBE, bExito, sMensaje)

            Return listProveedorBE

        Catch ex As Exception
            MsgBox(ex.Message, vbCritical, "Error del sistema")
            Return Nothing
            Exit Function
        End Try
    End Function

    Public Function ProveedorListarSel() As List(Of ProveedorBE)
        Try
            Dim listProveedorBE As List(Of ProveedorBE) = Nothing
            Dim objProveedorDALC As ProveedorDALC = Nothing

            objProveedorDALC = New ProveedorDALC
            listProveedorBE = New List(Of ProveedorBE)()
            listProveedorBE = objProveedorDALC.ListarProveedorSel
            Return listProveedorBE

        Catch ex As Exception
            MsgBox(ex.Message, vbCritical, "Error del sistema")
            Return Nothing
            Exit Function
        End Try
    End Function


    Public Function ValidarProveedorListar(ByVal objProveedorBE As ProveedorBE, ByRef bExito As Boolean, ByRef sMensaje As String) As List(Of ProveedorBE)
        Try
            Dim listProveedorBE As List(Of ProveedorBE) = Nothing
            Dim objCategoriaDALC As ProveedorDALC = Nothing

            objCategoriaDALC = New ProveedorDALC
            listProveedorBE = New List(Of ProveedorBE)()
            listProveedorBE = objCategoriaDALC.ValidarProveedor(objProveedorBE, bExito, sMensaje)

            Return listProveedorBE

        Catch ex As Exception
            Throw
        End Try
    End Function



End Class
